#ifndef __COLUMN_H__
#define __COLUMN_H__

#include <sql.h>
#include <sqlext.h>

#include <string>

class Column {
    SQLHENV      env;
    SQLHDBC      dbc;
    SQLHSTMT     stmt;
    SQLPOINTER   Value;
    SQLLEN       DispLen;
    SQLLEN       IntLen;
    SQLLEN       StrLen;

    SQLULEN     Prec;
    SQLSMALLINT Scale;
    SQLSMALLINT Nullable;
public:
    SQLUSMALLINT ColumnNumber;
    UCHAR        Name[256];
    SQLSMALLINT  SqlType;
    SQLSMALLINT  TargetType;

    Column(SQLHENV env, SQLHDBC dbc, SQLHSTMT stmt, SQLUSMALLINT id);
    operator int();
    operator short();
    operator unsigned char*();
    std::string asString();
    ~Column();
};

std::ostream& operator << (std::ostream& out, Column c);

#endif /* __COLUMN_H__ */

